import Mock from 'mockjs'

let depts = [
  {
    id: 1,
    name: 'HR'
  }, {
    id: 2,
    name: 'DEV'
  }
];
let titles = [
  {
    id: 1,
    name: 'employee'
  }, {
    id: 2,
    name: 'manager'
  }
]

let supers = [
  {
    id: 1,
    name: 'Lee'
  }, {
    id: 2,
    name: 'Mat'
  }
]


let employees = Mock.mock({
  "list|5": [{
    "id|+1": 1,
    "name": "@cname",
    "age": "@natural(20,60)",
    "dept|1": [
      {
        id: 1,
        name: 'HR'
      }, {
        id: 2,
        name: 'DEV'
      }
    ], "title|1": [
      {
        id: 1,
        name: 'employee'
      }, {
        id: 2,
        name: 'manager'
      }
    ], "status|1":["in","out"]
    /*上级、职务*/
  }]
})

Mock.mock("http://test.org/dept/list", "get", depts)
Mock.mock("http://test.org/title/list", "get", titles)
Mock.mock("http://test.org/super/list", "get", supers)
Mock.mock("http://test.org/employee/list", "get", employees.list)


